﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace AWiFi
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnWiFi_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Phone.Tasks.ConnectionSettingsTask task = new Microsoft.Phone.Tasks.ConnectionSettingsTask();
            task.ConnectionSettingsType = Microsoft.Phone.Tasks.ConnectionSettingsType.WiFi;
            task.Show();
        }

        private void btnPin_Click(object sender, RoutedEventArgs e)
        {
            StandardTileData data = new StandardTileData()
            {
                Title = "Config Wi-Fi",
                BackgroundImage =  new Uri("dog.png", UriKind.Relative)
            };
            ShellTile.Create(new Uri("/ConfigWiFi.xaml", UriKind.Relative), data);
        }

        private void btnNetWork_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Phone.Tasks.ConnectionSettingsTask task = new Microsoft.Phone.Tasks.ConnectionSettingsTask();
            task.ConnectionSettingsType = Microsoft.Phone.Tasks.ConnectionSettingsType.Cellular;
            task.Show();
        }

        private void btnPinNetWork_Click(object sender, RoutedEventArgs e)
        {
            StandardTileData data = new StandardTileData()
            {
                Title = "Config Cellular",
                BackgroundImage = new Uri("dog.png", UriKind.Relative)
            };
            ShellTile.Create(new Uri("/ConfigCellular.xaml", UriKind.Relative), data);
        }
    }
}